package com.example.feign.interfaces;

import com.example.feign.fallback.TestFeignFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author yangjianrong
 * @date 2020/7/3 17:22
 **/

//provider是提供服务的服务名 即provider模块
//关联fallback = TestFeignFallback.class 一旦错误就回调同名称的方法
@FeignClient(value = "provider",fallback = TestFeignFallback.class)
public interface TestFeign {
    @RequestMapping(value = "/test")
    String testByFeign();

    @RequestMapping(value = "/testone")
    String testOne(@RequestParam String msg);

    @RequestMapping(value = "/test1")
    String test1();
}